// https://gist.github.com/rluvaton/a97a8da46ab6541a3e5702e83b9d357b
// Generated from https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err
// Extra not including
// class_error not inserted
export enum MongoErrorCode {
  OK = 0,
  INTERNAL_ERROR = 1,
  BAD_VALUE = 2,
  OBSOLETE_DUPLICATE_KEY = 3,
  NO_SUCH_KEY = 4,
  GRAPH_CONTAINS_CYCLE = 5,
  HOST_UNREACHABLE = 6,
  HOST_NOT_FOUND = 7,
  UNKNOWN_ERROR = 8,
  FAILED_TO_PARSE = 9,
  CANNOT_MUTATE_OBJECT = 10,
  USER_NOT_FOUND = 11,
  UNSUPPORTED_FORMAT = 12,
  UNAUTHORIZED = 13,
  TYPE_MISMATCH = 14,
  OVERFLOW = 15,
  INVALID_LENGTH = 16,
  PROTOCOL_ERROR = 17,
  AUTHENTICATION_FAILED = 18,
  CANNOT_REUSE_OBJECT = 19,
  ILLEGAL_OPERATION = 20,
  EMPTY_ARRAY_OPERATION = 21,
  INVALID_B_S_O_N = 22,
  ALREADY_INITIALIZED = 23,
  LOCK_TIMEOUT = 24,
  REMOTE_VALIDATION_ERROR = 25,
  NAMESPACE_NOT_FOUND = 26,
  INDEX_NOT_FOUND = 27,
  PATH_NOT_VIABLE = 28,
  NON_EXISTENT_PATH = 29,
  INVALID_PATH = 30,
  ROLE_NOT_FOUND = 31,
  ROLES_NOT_RELATED = 32,
  PRIVILEGE_NOT_FOUND = 33,
  CANNOT_BACKFILL_ARRAY = 34,
  USER_MODIFICATION_FAILED = 35,
  REMOTE_CHANGE_DETECTED = 36,
  FILE_RENAME_FAILED = 37,
  FILE_NOT_OPEN = 38,
  FILE_STREAM_FAILED = 39,
  CONFLICTING_UPDATE_OPERATORS = 40,
  FILE_ALREADY_OPEN = 41,
  LOG_WRITE_FAILED = 42,
  CURSOR_NOT_FOUND = 43,
  USER_DATA_INCONSISTENT = 45,
  LOCK_BUSY = 46,
  NO_MATCHING_DOCUMENT = 47,
  NAMESPACE_EXISTS = 48,
  INVALID_ROLE_MODIFICATION = 49,
  MAX_TIME_MS_EXPIRED = 50,
  MANUAL_INTERVENTION_REQUIRED = 51,
  DOLLAR_PREFIXED_FIELD_NAME = 52,
  INVALID_ID_FIELD = 53,
  NOT_SINGLE_VALUE_FIELD = 54,
  INVALID_D_B_REF = 55,
  EMPTY_FIELD_NAME = 56,
  DOTTED_FIELD_NAME = 57,
  ROLE_MODIFICATION_FAILED = 58,
  COMMAND_NOT_FOUND = 59,
  OBSOLETE_DATABASE_NOT_FOUND = 60,
  SHARD_KEY_NOT_FOUND = 61,
  OPLOG_OPERATION_UNSUPPORTED = 62,
  STALE_SHARD_VERSION = 63,
  WRITE_CONCERN_FAILED = 64,
  MULTIPLE_ERRORS_OCCURRED = 65,
  IMMUTABLE_FIELD = 66,
  CANNOT_CREATE_INDEX = 67,
  INDEX_ALREADY_EXISTS = 68,
  AUTH_SCHEMA_INCOMPATIBLE = 69,
  SHARD_NOT_FOUND = 70,
  REPLICA_SET_NOT_FOUND = 71,
  INVALID_OPTIONS = 72,
  INVALID_NAMESPACE = 73,
  NODE_NOT_FOUND = 74,
  WRITE_CONCERN_LEGACY_O_K = 75,
  NO_REPLICATION_ENABLED = 76,
  OPERATION_INCOMPLETE = 77,
  COMMAND_RESULT_SCHEMA_VIOLATION = 78,
  UNKNOWN_REPL_WRITE_CONCERN = 79,
  ROLE_DATA_INCONSISTENT = 80,
  NO_MATCH_PARSE_CONTEXT = 81,
  NO_PROGRESS_MADE = 82,
  REMOTE_RESULTS_UNAVAILABLE = 83,
  DUPLICATE_KEY_VALUE = 84,
  INDEX_OPTIONS_CONFLICT = 85,
  INDEX_KEY_SPECS_CONFLICT = 86,
  CANNOT_SPLIT = 87,
  SPLIT_FAILED_OBSOLETE = 88,
  NETWORK_TIMEOUT = 89,
  CALLBACK_CANCELED = 90,
  SHUTDOWN_IN_PROGRESS = 91,
  SECONDARY_AHEAD_OF_PRIMARY = 92,
  INVALID_REPLICA_SET_CONFIG = 93,
  NOT_YET_INITIALIZED = 94,
  NOT_SECONDARY = 95,
  OPERATION_FAILED = 96,
  NO_PROJECTION_FOUND = 97,
  DB_PATH_IN_USE = 98,
  UNSATISFIABLE_WRITE_CONCERN = 100,
  OUTDATED_CLIENT = 101,
  INCOMPATIBLE_AUDIT_METADATA = 102,
  NEW_REPLICA_SET_CONFIGURATION_INCOMPATIBLE = 103,
  NODE_NOT_ELECTABLE = 104,
  INCOMPATIBLE_SHARDING_METADATA = 105,
  DISTRIBUTED_CLOCK_SKEWED = 106,
  LOCK_FAILED = 107,
  INCONSISTENT_REPLICA_SET_NAMES = 108,
  CONFIGURATION_IN_PROGRESS = 109,
  CANNOT_INITIALIZE_NODE_WITH_DATA = 110,
  NOT_EXACT_VALUE_FIELD = 111,
  WRITE_CONFLICT = 112,
  INITIAL_SYNC_FAILURE = 113,
  INITIAL_SYNC_OPLOG_SOURCE_MISSING = 114,
  COMMAND_NOT_SUPPORTED = 115,
  DOC_TOO_LARGE_FOR_CAPPED = 116,
  CONFLICTING_OPERATION_IN_PROGRESS = 117,
  NAMESPACE_NOT_SHARDED = 118,
  INVALID_SYNC_SOURCE = 119,
  OPLOG_START_MISSING = 120,
  DOCUMENT_VALIDATION_FAILURE = 121,
  OBSOLETE_READ_AFTER_OPTIME_TIMEOUT = 122,
  NOT_A_REPLICA_SET = 123,
  INCOMPATIBLE_ELECTION_PROTOCOL = 124,
  COMMAND_FAILED = 125,
  RPC_PROTOCOL_NEGOTIATION_FAILED = 126,
  UNRECOVERABLE_ROLLBACK_ERROR = 127,
  LOCK_NOT_FOUND = 128,
  LOCK_STATE_CHANGE_FAILED = 129,
  SYMBOL_NOT_FOUND = 130,
  OBSOLETE_CONFIG_SERVERS_INCONSISTENT = 132,
  FAILED_TO_SATISFY_READ_PREFERENCE = 133,
  READ_CONCERN_MAJORITY_NOT_AVAILABLE_YET = 134,
  STALE_TERM = 135,
  CAPPED_POSITION_LOST = 136,
  INCOMPATIBLE_SHARDING_CONFIG_VERSION = 137,
  REMOTE_OPLOG_STALE = 138,
  JS_INTERPRETER_FAILURE = 139,
  INVALID_SSL_CONFIGURATION = 140,
  SSL_HANDSHAKE_FAILED = 141,
  JS_UNCATCHABLE_ERROR = 142,
  CURSOR_IN_USE = 143,
  INCOMPATIBLE_CATALOG_MANAGER = 144,
  POOLED_CONNECTIONS_DROPPED = 145,
  EXCEEDED_MEMORY_LIMIT = 146,
  Z_LIB_ERROR = 147,
  READ_CONCERN_MAJORITY_NOT_ENABLED = 148,
  NO_CONFIG_MASTER = 149,
  STALE_EPOCH = 150,
  OPERATION_CANNOT_BE_BATCHED = 151,
  OPLOG_OUT_OF_ORDER = 152,
  CHUNK_TOO_BIG = 153,
  INCONSISTENT_SHARD_IDENTITY = 154,
  CANNOT_APPLY_OPLOG_WHILE_PRIMARY = 155,
  OBSOLETE_NEEDS_DOCUMENT_MOVE = 156,
  CAN_REPAIR_TO_DOWNGRADE = 157,
  MUST_UPGRADE = 158,
  DURATION_OVERFLOW = 159,
  MAX_STALENESS_OUT_OF_RANGE = 160,
  INCOMPATIBLE_COLLATION_VERSION = 161,
  COLLECTION_IS_EMPTY = 162,
  ZONE_STILL_IN_USE = 163,
  INITIAL_SYNC_ACTIVE = 164,
  VIEW_DEPTH_LIMIT_EXCEEDED = 165,
  COMMAND_NOT_SUPPORTED_ON_VIEW = 166,
  OPTION_NOT_SUPPORTED_ON_VIEW = 167,
  INVALID_PIPELINE_OPERATOR = 168,
  COMMAND_ON_SHARDED_VIEW_NOT_SUPPORTED_ON_MONGOD = 169,
  TOO_MANY_MATCHING_DOCUMENTS = 170,
  CANNOT_INDEX_PARALLEL_ARRAYS = 171,
  TRANSPORT_SESSION_CLOSED = 172,
  TRANSPORT_SESSION_NOT_FOUND = 173,
  TRANSPORT_SESSION_UNKNOWN = 174,
  QUERY_PLAN_KILLED = 175,
  FILE_OPEN_FAILED = 176,
  ZONE_NOT_FOUND = 177,
  RANGE_OVERLAP_CONFLICT = 178,
  WINDOWS_PDH_ERROR = 179,
  BAD_PERF_COUNTER_PATH = 180,
  AMBIGUOUS_INDEX_KEY_PATTERN = 181,
  INVALID_VIEW_DEFINITION = 182,
  CLIENT_METADATA_MISSING_FIELD = 183,
  CLIENT_METADATA_APP_NAME_TOO_LARGE = 184,
  CLIENT_METADATA_DOCUMENT_TOO_LARGE = 185,
  CLIENT_METADATA_CANNOT_BE_MUTATED = 186,
  LINEARIZABLE_READ_CONCERN_ERROR = 187,
  INCOMPATIBLE_SERVER_VERSION = 188,
  PRIMARY_STEPPED_DOWN = 189,
  MASTER_SLAVE_CONNECTION_FAILURE = 190,
  OBSOLETE_BALANCER_LOST_DISTRIBUTED_LOCK = 191,
  FAIL_POINT_ENABLED = 192,
  NO_SHARDING_ENABLED = 193,
  BALANCER_INTERRUPTED = 194,
  VIEW_PIPELINE_MAX_SIZE_EXCEEDED = 195,
  INVALID_INDEX_SPECIFICATION_OPTION = 197,
  OBSOLETE_RECEIVED_OP_REPLY_MESSAGE = 198,
  REPLICA_SET_MONITOR_REMOVED = 199,
  CHUNK_RANGE_CLEANUP_PENDING = 200,
  CANNOT_BUILD_INDEX_KEYS = 201,
  NETWORK_INTERFACE_EXCEEDED_TIME_LIMIT = 202,
  SHARDING_STATE_NOT_INITIALIZED = 203,
  TIME_PROOF_MISMATCH = 204,
  CLUSTER_TIME_FAILS_RATE_LIMITER = 205,
  NO_SUCH_SESSION = 206,
  INVALID_UUID = 207,
  TOO_MANY_LOCKS = 208,
  STALE_CLUSTER_TIME = 209,
  CANNOT_VERIFY_AND_SIGN_LOGICAL_TIME = 210,
  KEY_NOT_FOUND = 211,
  INCOMPATIBLE_ROLLBACK_ALGORITHM = 212,
  DUPLICATE_SESSION = 213,
  AUTHENTICATION_RESTRICTION_UNMET = 214,
  DATABASE_DROP_PENDING = 215,
  ELECTION_IN_PROGRESS = 216,
  INCOMPLETE_TRANSACTION_HISTORY = 217,
  UPDATE_OPERATION_FAILED = 218,
  FTDC_PATH_NOT_SET = 219,
  FTDC_PATH_ALREADY_SET = 220,
  INDEX_MODIFIED = 221,
  CLOSE_CHANGE_STREAM = 222,
  ILLEGAL_OP_MSG_FLAG = 223,
  QUERY_FEATURE_NOT_ALLOWED = 224,
  TRANSACTION_TOO_OLD = 225,
  ATOMICITY_FAILURE = 226,
  CANNOT_IMPLICITLY_CREATE_COLLECTION = 227,
  SESSION_TRANSFER_INCOMPLETE = 228,
  MUST_DOWNGRADE = 229,
  D_N_S_HOST_NOT_FOUND = 230,
  D_N_S_PROTOCOL_ERROR = 231,
  MAX_SUB_PIPELINE_DEPTH_EXCEEDED = 232,
  TOO_MANY_DOCUMENT_SEQUENCES = 233,
  RETRY_CHANGE_STREAM = 234,
  INTERNAL_ERROR_NOT_SUPPORTED = 235,
  FOR_TESTING_ERROR_EXTRA_INFO = 236,
  CURSOR_KILLED = 237,
  NOT_IMPLEMENTED = 238,
  SNAPSHOT_TOO_OLD = 239,
  DNS_RECORD_TYPE_MISMATCH = 240,
  CONVERSION_FAILURE = 241,
  CANNOT_CREATE_COLLECTION = 242,
  INCOMPATIBLE_WITH_UPGRADED_SERVER = 243,
  NOT_YET_AVAILABLE_TRANSACTION_ABORTED = 244,
  BROKEN_PROMISE = 245,
  SNAPSHOT_UNAVAILABLE = 246,
  PRODUCER_CONSUMER_QUEUE_BATCH_TOO_LARGE = 247,
  PRODUCER_CONSUMER_QUEUE_END_CLOSED = 248,
  STALE_DB_VERSION = 249,
  STALE_CHUNK_HISTORY = 250,
  NO_SUCH_TRANSACTION = 251,
  REENTRANCY_NOT_ALLOWED = 252,
  FREE_MON_HTTP_IN_FLIGHT = 253,
  FREE_MON_HTTP_TEMPORARY_FAILURE = 254,
  FREE_MON_HTTP_PERMANENT_FAILURE = 255,
  TRANSACTION_COMMITTED = 256,
  TRANSACTION_TOO_LARGE = 257,
  UNKNOWN_FEATURE_COMPATIBILITY_VERSION = 258,
  KEYED_EXECUTOR_RETRY = 259,
  INVALID_RESUME_TOKEN = 260,
  TOO_MANY_LOGICAL_SESSIONS = 261,
  EXCEEDED_TIME_LIMIT = 262,
  OPERATION_NOT_SUPPORTED_IN_TRANSACTION = 263,
  TOO_MANY_FILES_OPEN = 264,
  ORPHANED_RANGE_CLEAN_UP_FAILED = 265,
  FAIL_POINT_SET_FAILED = 266,
  PREPARED_TRANSACTION_IN_PROGRESS = 267,
  CANNOT_BACKUP = 268,
  DATA_MODIFIED_BY_REPAIR = 269,
  REPAIRED_REPLICA_SET_NODE = 270,
  JS_INTERPRETER_FAILURE_WITH_STACK = 271,
  SOCKET_EXCEPTION = 9001,
  OBSOLETE_RECV_STALE_CONFIG = 9996,
  NOT_MASTER = 10107,
  CANNOT_GROW_DOCUMENT_IN_CAPPED_NAMESPACE = 10003,
  BSON_OBJECT_TOO_LARGE = 10334,
  DUPLICATE_KEY = 11000,
  INTERRUPTED_AT_SHUTDOWN = 11600,
  INTERRUPTED = 11601,
  INTERRUPTED_DUE_TO_STEP_DOWN = 11602,
  OUT_OF_DISK_SPACE = 14031,
  KEY_TOO_LONG = 17280,
  BACKGROUND_OPERATION_IN_PROGRESS_FOR_DATABASE = 12586,
  BACKGROUND_OPERATION_IN_PROGRESS_FOR_NAMESPACE = 12587,
  NOT_MASTER_OR_SECONDARY = 13436,
  NOT_MASTER_NO_SLAVE_OK = 13435,
  SHARD_KEY_TOO_BIG = 13334,
  STALE_CONFIG = 13388,
  DATABASE_DIFFER_CASE = 13297,
  OBSOLETE_PREPARE_CONFIGS_FAILED = 13104,
}
